package domain;

import java.util.Date;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;
import javax.persistence.Table;

@Entity
@Table(name="t_topic")
public class Topic {
	private int Topic_id;
	private String content;//内容
	private Date post_time;
	private User post_user;//发布人
	
	@OneToOne(cascade=CascadeType.ALL,fetch=FetchType.EAGER)
	@JoinColumn(name="post_user_id")
	public User getPost_user() {
		return post_user;
	}
	public void setPost_user(User post_user) {
		this.post_user = post_user;
	}

	public String getContent() {
		return content;
	}
	@Id
	@GeneratedValue
	
	public int getTopic_id() {
		return Topic_id;
	}
	public void setTopic_id(int topic_id) {
		Topic_id = topic_id;
	}
	public void setContent(String content) {
		this.content = content;
	}
	public Date getPost_time() {
		return post_time;
	}
	public void setPost_time(Date post_time) {
		this.post_time = post_time;
	}
	
	
	
}
